package com.icebergteam.warfacewidget.core.connection.services;

public class BasicService implements Service {
	final private String borderSymbol = "/";
	
	protected String path = "";
	protected ServiceParameters parameters = null;
	
	public BasicService() {
		this.path = "/";
	}
		
	@Override
	public String getServiceInfo() {
		return "It`s a basic service";
	}
	
	@Override
	public String getPath() {
		return this.path;
	}

	@Override
	final public boolean isValid() {
		//if(this.path.startsWith(borderSymbol) && this.path.endsWith(borderSymbol))
			return true;
		
		//return false;
	}

	@Override
	public void setParameters(ServiceParameters parameters) {
		this.parameters = parameters;
	}

	@Override
	public String getParameters() {
		return (this.parameters != null ? this.parameters.getParameters() : "");
	}

	@Override
	public boolean hasParameters() {
		if(this.parameters == null || this.parameters.getParameters().length() == 0)
			return false;
		return true;		
	}
}
